package com.drought.rained.network;

import com.drought.rained.response.AnnouncementResponseLJ;
import com.drought.rained.response.AuthInfoResponseLJ;
import com.drought.rained.response.AuthResponseLJ;
import com.drought.rained.response.BindedCardResponseLJ;
import com.drought.rained.response.BlankResponseLJ;
import com.drought.rained.response.CalculateResponseLJ;
import com.drought.rained.response.CheckOrderQualificationsResponseLJ;
import com.drought.rained.response.CompareResultResponseLJ;
import com.drought.rained.response.CreateOrderResponseLJ;
import com.drought.rained.response.DictionaryResponseLJ;
import com.drought.rained.response.HelpCenterResponseLJ;
import com.drought.rained.response.IdentityResponseLJ;
import com.drought.rained.response.LoginMethodResponseLJ;
import com.drought.rained.response.LoginResponseLJ;
import com.drought.rained.response.OrderDetailResponseLJ;
import com.drought.rained.response.OrderItemResponseLJ;
import com.drought.rained.response.PayCodeResponseLJ;
import com.drought.rained.response.PersonalInfoResponseLJ;
import com.drought.rained.response.ProductResponseLJ;
import com.drought.rained.response.PullAddressResponseLJ;
import com.drought.rained.response.RolloveResponseLJ;
import com.drought.rained.response.UpdateResponseLJ;
import com.drought.rained.response.UserInformationResponseLJ;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;

public interface ApiServiceLJ {

    String HEADER_TOKEN_KEY = "Authorization";
    String PATH = "channel";
    String UL="/api/";

    @POST( UL+ "app/user/authentication/app-api/get/status") // 获取认证状态(七步)   监测假登陆也使用该接口
    Observable<AuthResponseLJ> getAuthStatus(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loan/common/{channel}/getLoginType") // 登陆方式
    Observable<LoginMethodResponseLJ> getLoginMethod(@Path(PATH) String channel, @Body RequestBody commonParams);

    @POST( UL+ "auth/jwt/{channel}/accountKitLogin") // facebook登陆
    Observable<LoginResponseLJ> uploadFaceBookCode(@Path("channel") String channel, @Body RequestBody commonParams);

    @POST( UL+ "auth/jwt/login") // 老用户登陆
    Observable<LoginResponseLJ> login(@Body RequestBody body);

    @POST( UL+ "app/loan/common/{channel}/getNoticeByChannel") // 公告
    Observable<AnnouncementResponseLJ> getAnnouncement(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loan/common/{channel}/prodRangeNew") // 获取产品(首页)
    Observable<ProductResponseLJ> getProductNew(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanProdDetail/calculate") // 计算费用
    Observable<CalculateResponseLJ> getCalculateData(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanOrderApply/{channel}/getOrderPageList") // 获取账单列表
    Observable<OrderItemResponseLJ> getOrderPageList(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loanOrderApply/{channel}/checkOrderQualifications") // 检查提单
    Observable<CheckOrderQualificationsResponseLJ> checkOrderQualifications(@Path("channel") String channel, @Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanOrderApply/{channel}/createOrder") // 创建订单
    Observable<CreateOrderResponseLJ> createOrder(@Path("channel") String channel, @Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanBankList/app-api/get/auth/bank/detail") // 获取银行卡
    Observable<BindedCardResponseLJ> getBindedCardData(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanBankList/app-api/save/or/update") // 提交银行卡
    Observable<BlankResponseLJ> saveBankCardInfo(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanIdentity/{channel}/getIdentityInfo") // 获取用户信息 (验证1回显)
    Observable<PersonalInfoResponseLJ> getPersonInfo(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/dictInfo/{channel}/queryDictInfoList") // 获取字典数据
    Observable<DictionaryResponseLJ> getDictionaryData(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/user/authentication/app-api/get/detail")
    Observable<AuthInfoResponseLJ> getAuthInfoData(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody body);

    @POST( UL+ "app/loanContactsInfo/app-api/save/or/update") // 提交通讯录信息（验证3）
    Observable<BlankResponseLJ> uploadContactData(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/loanCustomerInfo/app-api/save/or/update")
    Observable<BlankResponseLJ> savePersonalAuth(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody body);

    @Multipart // 上传身份证
    @POST( UL+ "app/user/authentication/app-api/upload/image")
    Observable<IdentityResponseLJ> uploadIdentityCard(@Header(HEADER_TOKEN_KEY) String header,
                                                      @QueryMap HashMap<String, Object> map, @Part MultipartBody.Part file);

    @Multipart // 上传图片
    @POST( UL+ "app/user/authentication/app-api/upload/image")
    Observable<IdentityResponseLJ> uploadSingleImg(@Header(HEADER_TOKEN_KEY) String header,
                                                   @QueryMap HashMap<String, Object> map, @Part MultipartBody.Part file);

    @POST( UL+ "app/user/authentication/app-api/update/additional/information")
    Observable<BlankResponseLJ> saveAddInformation(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loanIdentity/app-api/save/or/update")// 身份证信息保存
    Observable<BlankResponseLJ> saveIdentity(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/user/authentication/app-api/face/compare") // 图片校验
    Observable<CompareResultResponseLJ> imgCompare(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loanOrderApply/app-api/get/back/status") // 获取资料退回
    Observable<UserInformationResponseLJ> getUserInformation(@Header(HEADER_TOKEN_KEY) String header, @Body RequestBody body);

    @POST( UL+ "app/helpCenter/{channel}/getHelpCenterByChannel") // 帮助中心
    Observable<HelpCenterResponseLJ> getHelpCenter(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody body);

    @POST( UL+ "app/loanOrderApply/{channel}/savePayCode") // 获取还款码
    Observable<PayCodeResponseLJ> getPayCodeData(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loanOrderApply/{channel}/saveExtendedPayCode") // 获取展期还款码
    Observable<PayCodeResponseLJ> getRolloverPayCodeData(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loanOrderApply/{channel}/extensionTotalAmountOfMoney") // 获取展期订单
    Observable<RolloveResponseLJ> getRolloverOrder(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loan/common/{channel}/rolloverApp") // 展期可配
    Observable<BlankResponseLJ> checkCollectStatus(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST( UL+ "app/loanLonglatitude/{channel}/saveLonglatitude") // 上报位置信息
    Observable<BlankResponseLJ> uploadLocation(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @Multipart
    @POST( UL+ "app/loan/address/book/{channel}/pullUserData") // 拉去通讯录接口
    Observable<PullAddressResponseLJ> pullAddress(@Path("channel") String channel, @Header(HEADER_TOKEN_KEY) String  header, @PartMap Map<String, RequestBody> params, @Part MultipartBody.Part file);

    @POST( UL+ "app/loanOrderApply/{channel}/getOrderDetail") // 获取账单详情  待查
    Observable<OrderDetailResponseLJ> getOrderDetail(@Path(PATH) String channel, @Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

}
